package com.yumeko.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: First_Generation_Cloud
 * @description:
 * @author: Zheng Hao
 * @create: 2020-04-22 20:01
 */
@RestController
@RequestMapping("/config")
@RefreshScope //用于分布式动态刷新 本地直接 idea 的 rest client  post 请求即可
// 运维人员改过需要 多做一步 curl -X POST "http://localhost:1110/actuator/refresh"
public class ConfigController {

    @Value("${config.info}") //统一配置文件的属性
    private String info;

    @GetMapping("/viewconfig")
    public String viewconfig() {
        return info;
    }
}
